<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2017/7/20
 * Time: 9:24
 * Project name: PHPTEST
 * File name: 1.php
 * @copyright Copyright (c) 2016 ZRX Software LLC
 * @license https://github.com/zhangrxiang
 * @since 1.0.0
 */
/**-----将数组中的所有键名修改为全大写或小写--*/
$case = array_change_key_case( [ 'a' => 1, 'b' => 2 ], CASE_UPPER );
print_r( $case );

//array_chunk — 将一个数组分割成多个
$array_chunk = array_chunk( [ 'a', 'b', 'c' ], 2, 1 );
print_r( $array_chunk );

//array_column — 返回数组中指定的一列
$records = array(
	array(
		'id'         => 2135,
		'first_name' => 'John',
		'last_name'  => 'Doe',
	),
	array(
		'id'         => 3245,
		'first_name' => 'Sally',
		'last_name'  => 'Smith',
	),
	array(
		'id'         => 5342,
		'first_name' => 'Jane',
		'last_name'  => 'Jones',
	),
	array(
		'id'         => 5623,
		'first_name' => 'Peter',
		'last_name'  => 'Doe',
	)
);

$first_names = array_column( $records, 'first_name', 'id' );
print_r( $first_names );

print_r( array_combine( [ 1, 2, 3, 4, 5 ], [ 5, 4, 3, 2, 1 ] ) );